package aa;

/**
 * 两轮电动车，继承于 ElectricVehicles
 */
public class TwoWheeler extends ElectricVehicles {
    // 新增属性
    private String tireSize;     // 轮胎尺寸
    private double loadCapacity; // 载重能力

    // 构造方法，使用 super 调用父类构造方法
    public TwoWheeler(String vehicleName, String vehicleNumber, double batteryCapacity,
                      String batteryType, double maxRange, double maxSpeed, double price,
                      String tireSize, double loadCapacity) {
        super(vehicleName, vehicleNumber, batteryCapacity, batteryType, maxRange, maxSpeed, price);
        this.tireSize = tireSize;
        this.loadCapacity = loadCapacity;
    }

    // Getter 和 Setter 方法
    public String getTireSize() {
        return tireSize;
    }

    public void setTireSize(String tireSize) {
        this.tireSize = tireSize;
    }

    public double getLoadCapacity() {
        return loadCapacity;
    }

    public void setLoadCapacity(double loadCapacity) {
        this.loadCapacity = loadCapacity;
    }

    // 重写 toString 方法，打印电动车的所有属性信息
    @Override
    public String toString() {
        return "两轮车类{" +
                "车辆名称='" + getVehicleName() + '\'' +
                ", 车辆编号='" + getVehicleNumber() + '\'' +
                ", 电池容量=" + getBatteryCapacity() + "kWh" +
                ", 电池类型='" + getBatteryType() + '\'' +
                ", 最大续航里程=" + getMaxRange() + "km" +
                ", 最高速度=" + getMaxSpeed() + "km/h" +
                ", 价格=" + getPrice() + "元" +
                ", 轮胎尺寸='" + tireSize + '\'' +
                ", 载重能力=" + loadCapacity +
                '}';
    }
}
